public class Zifuchuan
{
    public static void main(String[] args) {
        Context context = new Context();
        while (true) {
            context.doAction();
            if (context.getCurrentState() == State.STRING_EXTRACTED) {
                break;
            }
        }
    }
}